from django.conf.urls.defaults import *
from lp.settings import ROOT_URL, MEDIA_DEBUG, MEDIA_URL

urlpatterns = patterns('lp.lpx.views',
    (r'^%s$' %ROOT_URL,                                         'index'),
    (r'^%sproject/(?P<pid>\d+|new)/step1/$' %ROOT_URL,          'step1'),
    (r'^%sproject/(?P<pid>\d+)/step2/$' %ROOT_URL,              'step2'),
    (r'^%sproject/(?P<pid>\d+)/step3/$' %ROOT_URL,              'step3'),
    (r'^%sproject/(?P<pid>\d+)/solve/$' %ROOT_URL,              'solve'),
    (r'^%sproject/(?P<pid>\d+)/solution/$' %ROOT_URL,           'solution'),
    (r'^%sproject/(?P<pid>\d+)/delete/$' %ROOT_URL,             'delete'),
    (r'^%ssettings/(?P<config>user|language|login)/$' %ROOT_URL,'settings'),
    (r'^%ssettings/language/setlang/$' %ROOT_URL,               'setlang'),
    (r'^%ssettings/admin/' %ROOT_URL, include('django.contrib.admin.urls')),
    (r'^%sdocumentation/(?P<lang>[A-Za-z][A-Za-z])/$' %ROOT_URL,'documentation'),
)

if MEDIA_DEBUG:
    urlpatterns += patterns('',
    (r'^lp_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'lpx/media'}),
    )
